package test.serialization;

import java.io.IOException;

/**
 * Student实现了Serialiable而Teacher没有则直接抛异常
 */
public class MainSerial {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        Student s1 = new Student();
        s1.setAge(12);
        s1.setName("xiaoming");
        Teacher t1 = new Teacher();
        t1.setName("laoshi");
        s1.setTeacher(t1);
        Student sClone =  (Student) CloneUtil.deepCopy(s1);
        System.out.println(sClone);
    }
}
